@using Discussion.Core.Mvc
@using Discussion.Web.Services.ChatHistoryImporting
@inject Discussion.Core.Models.SiteSettings SiteSettings
@inject ChatyApiService ChatyApiService
@{
    Layout = "../Shared/_Layout.cshtml";
    
    var user = Context.DiscussionUser();
    var suggestVerifying = SiteSettings.RequireUserPhoneNumberVerified && !user.PhoneNumberId.HasValue;
}

@section Head{
    @RenderSection("Head", required: false)
}

<div class="row">
    <div class="hidden-xs hidden-sm col-md-4 col-lg-4 pull-right">
        <div class="panel">
            <div class="panel-heading">个人中心</div>
            <div class="panel-body">
                <ul>
                    <li>@Html.ActionLink("基本信息", "Settings", "User")</li>
                    <li>@Html.ActionLink("手机验证", "VerifyPhoneNumber", "User")</li>
                    @if (ChatyApiService.IsChatySupported(user.UserName))
                    {
                        <li>@Html.ActionLink("微信账号", "WeChatAccount", "User")</li>
                    }
                    <li>@Html.ActionLink("修改密码", "ChangePassword", "User")</li>
                </ul>
            </div>
        </div>
    </div>
    <div class="col-xs-12 col-sm-12 hidden-md hidden-lg no-padding">
        <div class="panel">
            <div class="panel-heading">
                @Html.ActionLink("基本信息", "Settings", "User")
                @Html.ActionLink("手机验证", "VerifyPhoneNumber", "User")
                @if (ChatyApiService.IsChatySupported(user.UserName))
                {
                    <li>@Html.ActionLink("微信账号", "WeChatAccount", "User")</li>
                }
                @Html.ActionLink("修改密码", "ChangePassword", "User")
            </div>
        </div>
    </div>
    <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8 no-padding pull-left">
        <div class="panel panel-body panel-user-settings">
        @if (SiteSettings.IsReadonly)
        {
            <div class="text-danger">
                <h4>当前站点处于维护期间，暂时无法保存你的设置信息，敬请谅解。</h4>     
            </div>
        }
            
        @if (suggestVerifying)
        {
            <div class="text-danger">
                <p>在验证实名手机号之前，不能创建话题、添加回复。@Html.ActionLink("现在验证", "VerifyPhoneNumber", "User") </p>     
            </div>
        }
            
        @RenderBody()
        </div>
    </div>
</div>

@section Tail{
    @RenderSection("Tail", required: false)
}